home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / cparser.exe / PARSE.DOC < prev    next >
Text File  |  1993-02-27  |  5KB  |  138 lines

  1. There is a feature that is desired, but does not exist in any
  2. of the borland C or C++ compilers.  Yet it does exist in their
  3. Pascal compilers. It's called "smart linking".  If you have a
  4. .c file that compiles down to one .OBJ file which has a hundred
  5. functions in it and you want only one, you still link in the
  6. WHOLE thing! AND, you link in all of the stuff that all of
  7. those other functions need to do their thing.  A .EXE file that
  8. could be 5k with smart linking ends up being 500k!  One
  9. solution is to break up your source files so that every tiny
  10. little function has it's own file. The problem with that is
  11. that it is then harder to understand, add to or change such
  12. files.
  13.  
  14. This program will open a .c source file and write out many .c
  15. source files.  It will then use the .PRJ file to call BCC to
  16. compile all the little .c files. Next, it takes the orginal
  17. big .OBJ out of the .LIB file and puts all of the tiny .OBJ
  18. files in.  Then it deletes all of the little .c and .obj files.
  19.  
  20. To make this program work as is, you must be using the IDE with
  21. "C++ always" toggled on.  Your file names should always end in
  22. .c whether you are using C++ or not.  Your .PRJ must be the
  23. same name as your .LIB (so your project calls the librarian
  24. instead of the linker when done).  You must copy PARSE.BAT and
  25. PARSER.EXE into a subdirectory that is in your path.
  26.  
  27. You also need to tell the parser where to parse.  In your .c
  28. file, put "//.parse" on a line by itself (on the very left
  29. edge) where ever you want your source to be parsed.  The first
  30. parse will be for all header information that will be copied to
  31. all of the little .c files.  Your new .c file might look like
  32. this:
  33.  
  34. -----------------------
  35. #include <stdio.h>
  36.  
  37. //.parse
  38.  
  39. void Foo()
  40.   {
  41.     puts("Have another day!  They're free!");
  42.   }
  43.  
  44. //.parse
  45.  
  46. void Bar()
  47.   {
  48.     puts("Time is Mother Nature's way of keeping everything");
  49.     puts("from happening at once!");
  50.   }
  51.  
  52. //.parse
  53.  
  54. void FooBar()
  55.   {
  56.     puts("Two all beef patties, special sauce, lettuce, cheese,");
  57.     puts("pickles, onions on a sesamie seed bun");
  58.   }
  59.  
  60. -----------------------
  61.  
  62. Go to the directory where you keep your .PRJ, .LIB and .C files
  63. for the library and type
  64.  
  65.     parse <cfilename> <libfilename>
  66.  
  67. without the filename extensions.
  68.  
  69. So, if you had a C filename called WSTR.C and a library name
  70. called WLIB.LIB, you would type
  71.  
  72.     parse wstr wlib
  73.  
  74.  
  75.  
  76. If you use this product, you must register it for $25.
  77. Registration will give you
  78.  
  79.     source code
  80.     non-programming support
  81.  
  82. $50 registration will give you
  83.  
  84.     source code
  85.     support (including programming support)
  86.  
  87. This includes support for the Wheaton Libraries (WLIB.ZIP)
  88. which comes with the source.
  89.  
  90. copyright (c) 1992, 1993 by Paul Wheaton
  91. 1916 Brooks #205, Missoula, MT  59801
  92.  
  93. voice phone:  (406)543-7543
  94. modem phone:  (406)543-1144 (2400N81)
  95.  CompuServe:  72707,207
  96.    Internet:  72707.207@CompuServe.com
  97.  
  98. Visa and MC accepted
  99.  
  100. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  101.  
  102. The Wheaton Libraries is a class library for C++
  103.  
  104. Some of the objects are
  105.  
  106.   String (dynamic string type with full type checking)
  107.   String40, String120 (static (stack) based strings)
  108.   Form (Pass in a value and get a string back like "1,234,555.22")
  109.   LinkedList (doubly linked list class)
  110.   CreateLinkedListClass (Make your own typed linked list)
  111.   Queue, Stack (variations on LinkedList)
  112.   File, TextFile, RecFile (Makes file manipulation much easier)
  113.   TokenFile (Store thousands of files or different objects in
  114.      one file - kinda like a heap on disk)
  115.   File utilities (a variety of functions for copying files,
  116.      taking CRC, etc)
  117.   ByteVector (a dynamic array of bytes)
  118.   CreateVectorClass (make vectors of any object you want)
  119.   BitVector (dynamic arrays of thousands of booleans that take up
  120.      one bit of memory for each boolean)
  121.   CreateBitSetClass (make static bitsets that work like the
  122.      BitSets in Turbo Pascal or Modula 2)
  123.   Date, JulianDate (objects for working with dates)
  124.   dBase (a C++ class interface for the CodeBase libraries)
  125.   BtrieveFile (a C++ class interface for the Btrieve libraries)
  126.   much, much more!
  127.  
  128. These libraries are designed for optimal use in the cold, cruel world of
  129. practical programming.  It is my belief that the molding of C++ into a
  130. SmallTalk environment kills the beauty of C++.  I write object oriented
  131. extensions to C++ that compiles very tight and fast while maintaining high
  132. portability.  If you want a SmallTalk-like environment, use SmallTalk!  I
  133. hope that this code allows all C++ programmers to develop smaller and
  134. faster programs in less time.
  135.  
  136. Look for the file WLIB.ZIP.  It includes full source code.
  137.  
  138.